import request from "@/utils/request";
import requesta from "@/utils/requesta";

// 查询工单SN码列表
export function listWorkorderSn(query) {
  return request({
    url: "/mes/pro/workorderSn/list",
    method: "get",
    params: query,
  });
}

// 查询工单SN码详细
export function getWorkorderSn(snId) {
  return request({
    url: "/mes/pro/workorderSn/" + snId,
    method: "get",
  });
}

// 新增工单SN码
export function addWorkorderSn(data) {
  return request({
    url: "/mes/pro/workorderSn",
    method: "post",
    data: data,
  });
}

// 更换SN码
export function replaceSn(data) {
  return request({
    url: "/mes/pro/workorderSn",
    method: "put",
    data: data,
  });
}

// 批量更换SN码
export function batchSn(data) {
  return request({
    url: "/mes/pro/workorderSn/editBatch",
    method: "post",
    data: data,
  });
}

// 详情
export function detailsWorkorderSn(snId) {
  return request({
    url: "/mes/pro/workorderSn/details/" + snId,
    method: "get",
  });
}

// 删除工单SN码
export function delWorkorderSn(snId) {
  return request({
    url: "/mes/pro/workorderSn/" + snId,
    method: "delete",
  });
}

// 产品调试报告

export function reportAll(query) {
  return request({
    url: "/mes/datacol/debugging/all",
    method: "get",
    params: query,
  });
}

// 打印SN码
export function printSn(data) {
  return requesta({
    url: "/hici/print", //'/mes/pro/workorderSn/print',
    method: "post",
    data: data,
  });
}

// 打印车载条码1
export function electricPile(data) {
  return requesta({
    url: "/hici/print/chezaiduan",
    method: "post",
    data: data,
  });
}

// 打印车载条码2
export function vehicle(data) {
  return requesta({
    url: "/hici/print/chezaichang",
    method: "post",
    data: data,
  });
}

// djj 新增 根据工单ID查询SN码
export function workorderSnList(query) {
  return request({
    url: "/mes/pro/workorderSn/list",
    method: "get",
    params: query,
  });
}

// djj 新增 委外业务--查询原有SN码
export function queryPcbaInfoList(query) {
  return request({
    url: "/mes/outbound/queryPcbaInfo",
    method: "get",
    params: query,
  });
}